package ch01.shangji.shangji1;

import java.lang.reflect.Modifier;

public class Person extends JavaBean implements java.io.Serializable{
    public static void main(String[] args) {
         Class clz = Person.class;
         String fullName = clz.getName();
         String simpleName = clz.getSimpleName();
         Class superClass = clz.getSuperclass();

        System.out.println("基本信息如下");
        System.out.println("类名" + fullName);
        int modifier = clz.getModifiers();
        if ((modifier & Modifier.PUBLIC) == Modifier.PUBLIC){
            System.out.println("访问修饰符是public");
        }else if ((modifier & Modifier.FINAL) == Modifier.PUBLIC){
            System.out.println("是final");
        }else if ((modifier & Modifier.ABSTRACT) == Modifier.ABSTRACT){
            System.out.println("是抽象类");
        }else if ((modifier & Modifier.INTERFACE) == Modifier.INTERFACE){
            System.out.println("是接口");
        }else {
            System.out.println("访问修饰符是default");
        }
        System.out.println("继承关系" + superClass.getName());
        System.out.println();
    }
}
